<div class="main f_r">
	<div class='tabs_content'>
		<div class="node">
			<table class="list_table" width="100%" cellpadding="0" cellspacing="0">
			    <colgroup>
    				<col width="160px" />
    				<col />
    				<col width="80px" />
    				<col width="60px"/>
			    </colgroup>

				<thead><tr><th>商品名称</th><th>内容</th><th>咨询时间</th><th>回复</th></tr></thead>
				<tbody>
					{set:$queryConsultList = Api::run('getUcenterConsult')}
					{foreach:items = $queryConsultList->find()}
					<script>var item{$key} = {echo:JSON::encode($item)};</script>
					<tr>
						<td class="t_l"><a href="{url:/site/products/id/$item['gid']}" target="_black">{$item['name']}</a></td>
						<td>{$item['question']}</td>
						<td>{echo:substr($item['time'],0,10)}</td>
						<td>
							{if:$item['status']==1}
							<a class="blue bold" href="javascript:show_msg(item{$key});">查看</a>
							{else:}
							未回复
							{/if}
						</td>
					</tr>
					{/foreach}
				</tbody>
				<tfoot><tr><td colspan="4">{$queryConsultList->getPageBar()}</td></tr></tfoot>
			</table>
		</div>
	</div>
</div>
<script type="text/javascript">
function show_msg(obj)
{
    var content = "<strong>咨询内容：</strong><p>"+obj.question+"</p><p>"+obj.time+"</p><hr/>";
    if(obj.answer)
    {
        content+= "<strong>商家回复：</strong><p>"+obj.answer+"</p><p>"+obj.reply_time+"</p>";
    }
    else
    {
        content+= "<strong>商家回复：</strong><p>请耐心等待...</p>";
    }
    art.dialog({"title":"商品咨询","content":content,"ok":function(){return true;}});
}
</script>
